﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;
using Mvc3Demo.Models;

namespace Mvc3Demo.Controllers
{
    public class InfoController : BaseController
    {
        [ChildActionOnly]
        [OutputCache(Duration = 60)]
        public PartialViewResult GetNews()
        {
            var newsList = new List<NewsModel>
                {
                    new NewsModel
                        {
                            ShortNews = "Test message 1",
                            Description = "Test message 2 with descriptions" + DateTime.Now.ToString()
                        },
                    new NewsModel
                        {
                            ShortNews = "Test message 2",
                            Description = "Test message 2 with descriptions" + DateTime.Now.ToString()
                        }
                };

            return PartialView(newsList);
        }
    }
}
